from pydantic import BaseModel, Field
from typing import Optional

from decimal import Decimal
from datetime import datetime


class CustomerInfoQuery(BaseModel):
    page: int = Field(1, ge=1, description="页码", alias="current")
    size: int = Field(10, ge=1, le=100, description="每页数量")

    id: Optional[int] = Field(None, description="按 主键ID 过滤")
    customer_code: Optional[str] = Field(None, description="按 客户编码 字符串模糊匹配")
    customer_name: Optional[str] = Field(None, description="按 客户名称 字符串模糊匹配")
    business_type: Optional[str] = Field(None, description="按 商机类别 字符串模糊匹配")
    division: Optional[str] = Field(None, description="按 事业部 字符串模糊匹配")
    category: Optional[str] = Field(None, description="按 类别 字符串模糊匹配")
    industry_type: Optional[str] = Field(None, description="按 行业别 字符串模糊匹配")
    strategy_industry: Optional[str] = Field(None, description="按 策略行业 字符串模糊匹配")
    customer_source: Optional[str] = Field(None, description="按 客户来源 字符串模糊匹配")
    salesperson: Optional[str] = Field(None, description="按 业务员 字符串模糊匹配")
    customer_product: Optional[str] = Field(None, description="按 客户产品 字符串模糊匹配")
    informatization_status: Optional[str] = Field(None, description="按 客户信息化现状 字符串模糊匹配")
    scale: Optional[str] = Field(None, description="按 营业规模 字符串模糊匹配")
    acpid: Optional[str] = Field(None, description="按 ACPID 字符串模糊匹配")
    address: Optional[str] = Field(None, description="按 地址 字符串模糊匹配")
    employee_count: Optional[int] = Field(None, description="按 员工人数 过滤")
    company_nature: Optional[str] = Field(None, description="按 企业性质 字符串模糊匹配")
    capital: Optional[Decimal] = Field(None, description="按 资本额 过滤")
    website: Optional[str] = Field(None, description="按 公司网址 字符串模糊匹配")
    created_by: Optional[str] = Field(None, description="按 创建人 字符串模糊匹配")
    create_time: Optional[datetime] = Field(None, description="按 创建时间 过滤")
    updated_by: Optional[str] = Field(None, description="按 更新人 字符串模糊匹配")
    update_time: Optional[datetime] = Field(None, description="按 更新时间 过滤")

    create_time_from: Optional[datetime] = Field(None, description="创建时间 起始")
    create_time_to: Optional[datetime] = Field(None, description="创建时间 结束")
    update_time_from: Optional[datetime] = Field(None, description="更新时间 起始")
    update_time_to: Optional[datetime] = Field(None, description="更新时间 结束")
